﻿using System;
using System.Linq;

using Ninject;
using Ninject.Modules;

namespace SSTU.Management.Dependency
{
	/// <summary>
	/// Contract for the dependency container.
	/// </summary>
	public interface IDependencyContainer
	{
		/// <summary>
		/// Gets the dependency kernel.
		/// </summary>
		KernelBase Kernel { get; }

		/// <summary>
		/// Initializes the specified module, and configure kernel with this module.
		/// </summary>
		/// <param name="module">The module.</param>
		void Initialize(INinjectModule module);

		/// <summary>
		/// Gets a value indicating whether this instance is initialized.
		/// </summary>
		bool IsInitialized { get; }

		/// <summary>
		/// Occurs when container and all dependencies initialized.
		/// </summary>
		event Action Initialized;
	}
}
